//
//  LCViewController.m
//  
//
//  Created by admin on 2017/4/23.
//  Copyright © 2017年 __MyCompanyName__. All rights reserved.
//

#import "LCViewController.h"
#import <Masonry.h>
#import "zhAlertView.h"
#import <zhPopupController/zhPopupController.h>


@interface LCViewController ()

@end

@implementation LCViewController


- (void)viewDidLoad {
    [super viewDidLoad];
//    UILabel *lab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 80, 40)];
//    lab.textColor = WHITE_COLOR;
//    lab.font = FONT(19);
//    lab.text = text;
//    lab.textAlignment = NSTextAlignmentCenter;
    
    [self setupBack];//设置左侧返回按钮

}
///创建Title图片
- (void)setupTitleImageView {
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.bounds = CGRectMake(0, 0, 70, 20);
    imageView.image = [UIImage imageNamed:@"title"];
    self.navigationItem.titleView = imageView;
}

///设置左侧返回按钮
- (void)setupBack {
    self.navigationController.navigationItem.hidesBackButton = YES;//隐藏系统的返回按钮
    
    UIBarButtonItem * item = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"home_nav_button_back"] style:UIBarButtonItemStyleDone target:self action:@selector(back)];
    [item setTintColor:RGBColor(89, 196, 120)];
    self.navigationItem.leftBarButtonItem = item;
    
    
    if (self.rightTitle.length > 0) {
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:_rightTitle style:UIBarButtonItemStyleDone target:self action:@selector(rightBtnAction)];
    }

}
-(void)rightBtnAction{
    
}

-(void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)addHubPromptMessage:(NSString *)message
{
    
//    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//    hud.mode = MBProgressHUDModeText;//枚举类型不同的效果
//    //    hud.mode = MBProgressHUDModeCustomView;
//    hud.label.text= [NSString stringWithFormat:@"%@",message];
//    [self performSelector:@selector(hiddenMBAction) withObject:nil afterDelay:1.0];
}
-(void)viewWillAppear:(BOOL)animated{
    //    [self setNeedsStatusBarAppearanceUpdate];
    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
}

#pragma mark - Alert loadFail 网页加载失败弹出框
- (void)example1 {
    zhAlertView *alert = [self alertView1];
    
    self.zh_popupController = [[zhPopupController alloc] init];
    [self.zh_popupController dropAnimatedWithRotateAngle:30];
    [self.zh_popupController presentContentView:alert duration:0 springAnimated:YES];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.zh_popupController dismiss];
    });
}
- (zhAlertView *)alertView1 {
    zhAlertView *alertView = [[zhAlertView alloc] initWithTitle:@"提示"
                                                        message:@"网页加载失败，请稍后重试! "
                                                  constantWidth:290];
    return alertView;
}

@end
